﻿using System;
using System.Collections.Generic;

namespace WD.Framework.Contract
{
    /// <summary>
    /// 用于BLL方法提传入条件
    /// </summary>
    public class Request : ModelBase
    {
        /// <summary>
        /// 默认构造函数
        /// </summary>
        public Request()
        {
            PageSize = 10;
            ShowDeleted = false;
            GetAll = false;
        }

        public int Top
        {
            set
            {
                this.PageSize = value;
                this.PageIndex = 1;
            }
        }

        //通用查询字段
        /// <summary>
        /// 每页数量
        /// </summary>
        public int PageSize { get; set; }
        /// <summary>
        /// 当前页码（1开始）
        /// </summary>
        public int PageIndex { get; set; }
        /// <summary>
        /// 排序字段
        /// </summary>
        public string OrderField { get; set; }
        /// <summary>
        /// 排序方向
        /// </summary>
        public string OrderDirection { get; set; }
        /// <summary>
        /// 查询关键字
        /// </summary>
        public string Keywords { get; set; }
        /// <summary>
        /// 显示已删除数据（默认False）
        /// </summary>
        public bool ShowDeleted { get; set; }
        /// <summary>
        /// 查询关联数据(表名集合)
        /// </summary>
        public List<string> Include { get; set; }
        /// <summary>
        /// 查询所有数据(默认False。为True时，忽略PageIndex，PageSize参数)
        /// </summary>
        public bool GetAll { get; set; }
        /// <summary>
        /// 用于存放关联表的ID
        /// </summary>
        public int Key { get; set; }
    }
}
